package com.wms.mapper;

import com.wms.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author Ayases
 * @Date 2025/5/5 16:35
 * @Desc
 */

public interface OutboundMapper {
    List<OutboundVO> findAll(OutboundDTO outboundDTO);

    void deleteOne(String outboundId);

    void pick(String outboundId);

    void confirm(String outboundId);

    List<OutboundVO> searchRelateData(String outboundId);


    void insertOutboundOrder(SaveDialogFormDTO dto);

    void insertOutboundLogistics(SaveDialogFormDTO dto);

    void insertOutboundProducts(@Param("item") SaveDialogFormDTO.GoodsItem item);

    void insertOutboundRelation(@Param("outboundId") String outboundId,
                                @Param("productId") String productId,
                                @Param("logisticsId") String logisticsId);

    void updateOutboundOrder(SaveDialogFormDTO dto);

    void deleteOutboundLogistics(SaveDialogFormDTO dto);

    void deleteOutboundProducts(@Param("item") SaveDialogFormDTO.GoodsItem item);

    void deleteOutboundRelation(@Param("outboundId") String outboundId,
                                @Param("productId") String productId,
                                @Param("logisticsId") String logisticsId);


    // 查询出库主表
    OutboundOrder selectOutboundOrderById(@Param("outboundId") String outboundId);

    // 查询关联的物流单号
    String selectLogisticsIdByOutboundId(@Param("outboundId") String outboundId);

    // 查询物流信息
    OutboundLogistics selectLogisticsById(@Param("logisticsId") String logisticsId);

    // 查询商品列表
    List<SaveDialogFormDTO.GoodsItem> selectProductsByOutboundId(@Param("outboundId") String outboundId);



}
